Example
> A = rand(4,4)
A =
0.493 0.161 0.137 0.879
0.782 0.0642 0.446 0.761
0.591 0.271 0.367 0.852
0.0721 0.0384 0.949 0.107
> X1 = rand(4,1)
X1 =
0.812
0.543
0.254
0.0825
> B1 = A*X1
B1 =
0.595
0.846
0.791
0.329
> X2 = rand(4,1)
X2 =
0.697
0.137
0.815
0.974
> B2 = A*X2
B2 =
1.33
1.66
1.58
0.933
> B = [B1,B2]
B =
0.595 1.33
0.846 1.66
0.791 1.58
0.329 0.933
> F = factor(A)
lu pvt rcond
> backsub(F,B)
0.812 0.697
0.543 0.137
0.254 0.815
0.0825 0.974
> // This is [X1,X2] - so it works!
See also: Page
factor()
,
Page
inv()
,
Page
solve()
.